package com.cameron.serviceedu.entity.dto.front;

import com.cameron.serviceedu.entity.EduCourse;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

@Data
public class CourseDto extends EduCourse {
    private String buyCountSort;
    @ApiModelProperty(value = "最新时间排序")
    private String gmtCreateSort;
    @ApiModelProperty(value = "价格排序")
    private String priceSort;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        CourseDto courseDto = (CourseDto) o;

        return new EqualsBuilder().appendSuper(super.equals(o)).append(buyCountSort, courseDto.buyCountSort).append(gmtCreateSort, courseDto.gmtCreateSort).append(priceSort, courseDto.priceSort).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37).appendSuper(super.hashCode()).append(buyCountSort).append(gmtCreateSort).append(priceSort).toHashCode();
    }
}
